<?php
// get the class
require_once('../../plainTemplates/plainTemplates.php');
// always end dir with a slash
plainTemplates::$cacheDir = '../../plainTemplates/cache/';
plainTemplates::clearCache();
//plainTemplates::$debug = true;
$data = array(
	'Post' => array(
		'title' => 'Im the title',
		'body' => 'Im the body',
	),
	'Comment' => array(
		array(
			'author' => 'Im the 1st comment of 1st post',
			'body' => "This field has same name as post's one",
		),
		array(
			'author' => 'Im the 2nd comment of 1st post',
			'body' => 'So am i',
		),
	)
);
// include to fully preserve scope
include(
	plainTemplates::createTemplate(
		// first the template source
		'template.htm',
		// second the var info
		array(
			// var name in scope
			'$data',
			// and var value
			$data,
			// finally the selectors (of course there are defaults, that is UL and LI)
			array(
				// empty container means that we dont want a loop
				'container' => '',
				// you can't use plain 'li', because all elements selected by this seletor except first one will be removed
				// in this case LI for comment row
				// there are other ways to write this selector, but this is the simplest
				'row'		=> '.someclass > ul > li',
				// this hasn't changed
				'Comment' => array(
					'container' => '.someclass > ul ul',
				),
			)
		)
	)
);
?>